import SourceView from "./source_view";
import SourceAndPreview from "./source_and_preview";
export class ViewProvider {
  provider(viewMode, editor) {
    this.viewMode_ = viewMode;
    switch (viewMode) {
      case "source":
        return new SourceView(editor);
      case "render":
        throw new Error("Sorry, not yet realized");
      case "sourceAndPreview":
        return new SourceAndPreview(editor);
      default:
        return new SourceView(editor);
    }
  }
}

export default ViewProvider;
